package com.kuang.controller;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 只要实现了controller接口的类，就说明这是一个控制器
 */
public class ControllerTest implements Controller {


    @Override
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {

        ModelAndView modelAndView = new ModelAndView();

        modelAndView.addObject("msg","ControllerTest");
        modelAndView.setViewName("test");
        System.out.println("commit");
        return modelAndView;
    }
}
